<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>

<!--
  v-for遍历数组
  <li v-for='item in list'>{{item}}}</li>
  <li v-for='(item, index) in list'> {{item}}, {{index}} </li>

  为了帮助Vue区分不同的元素，提高性能，通常我们会绑定key
  <li :key='item.id' v-for='(item, index) in list'> {{item}}, {{index}} </li>
-->

<div id="app">
  <ul id="example-2">
    <li v-for="(item, index) of items">
      {{ index }} - {{ item.message }}
    </li>
  </ul>
</div>

<script src="../lib/vue.js"></script>
<script>
  let vm = new Vue({
    el: '#app',
    data: {
      items: [
        { message: 'Foo' },
        { message: 'Bar' }
      ]
    }
  })
</script>

</body>
</html>